package com.wj.controller;

import cn.hutool.core.util.StrUtil;
import com.wj.pojo.Admin;
import com.wj.pojo.MailConstants;
import com.wj.pojo.Position;
import com.wj.utils.AdminUtil;
import com.wj.utils.FastDFSUtil;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.InputStream;
import java.security.Principal;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Api(tags = "test")
@RestController
@RequiredArgsConstructor
public class TestController {

    final RabbitTemplate rabbitTemplate;

    @GetMapping("/test3")
    public String test_3(){
        System.out.println(StringUtils.hasText(new StringBuffer().toString()));
        return "asdf";
    }

    @GetMapping("/test1")
    public Object test_1(){
        Admin admin = (Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        System.out.println(admin.getId());
        return "test1";
    }

    @GetMapping("/employee/advanced/test")
    public String test_2(){
        return "test_2";
    }
}
